package com.cskaoyan.factory;

import com.cskaoyan.bean.Car;
import org.springframework.beans.factory.FactoryBean;

/**
 * 通常生产的是什么实例，就叫XXXFactoryBean
 * @author stone
 * @date 2022/12/19 17:01
 */
public class CarFactoryBean implements FactoryBean<Car> {
    @Override
    public Car getObject() throws Exception {
        //方法体 提供一个你生产的实例
        Car car = new Car();
        car.setFrom("FactoryBean");
        return car;
    }

    @Override
    public Class<?> getObjectType() {
        return Car.class;
    }
}
